package com.test.springboot_test.stringTest;

import java.util.Arrays;

public class SpringTest13 {

    public static void main(String[] args) {

        //截取、索引
        String str = "1+1=@22";
        System.out.println(str.substring(0, str.lastIndexOf("@")));
        System.out.println(str.substring(str.lastIndexOf("@") + 1));
        //拼接
        String str2[]={"a","b","c"};
        StringBuilder builder = new StringBuilder();
        for(String a : str2){
            builder.append(a);
        }
        System.out.println(builder.toString());
        //分割
        String str1 = "1,2,3,4,5,6";
        String[] split = str1.split(",");
        Arrays.asList(split).stream().forEach(System.out::print);


    }


}
